var api = require('../../../../api.js');
var utils = require('../../../../utils.js');
// var WxParse = require('../../wxParse/wxParse.js');
var app = getApp();


Page({

    /**
     * 页面的初始数据
     */
    data: {
        banner: [{
                'name': "banner_01",
                "img": "http://image3.suning.cn/uimg/cms/img/153510358461850226.jpg"
            },
            {
                "name": 'banner_02',
                "img": "http://image3.suning.cn/uimg/cms/img/153510358461850226.jpg//image.suning.cn/uimg/aps/material/153509709677651818.jpg"
            }
        ],
        member: [{
                "id": "0",
                "img": "/page/casa/image/five.png",
                "name": "成为会员享特权"
            },
            {
                "id": "1",
                "img": "/page/casa/image/gift.png",
                "name": "邀请好友得奖励"
            },
        ],
        article: [{
                "id": "0",
                "img": "http://i1.mifile.cn/a4/xmad_15232433421155_vCzhJ.jpg",
                "name": "文章001"
            },
            {
                "id": "1",
                "img": "http://i1.mifile.cn/a4/xmad_15123939053142_dFlAw.jpg",
                "name": "文章002"
            },
            {
                "id": "2",
                "img": "http://i1.mifile.cn/a4/xmad_15266395374048_JnZQo.jpg",
                "name": "文章003"
            },
        ]
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        let that = this;
        app.request({
            url: api.default.index,
            method: 'GET',
            success: function(res) {
                console.log(res)
                let store = res.data.store;

                that.setData({
                    store:res.data.store
                })
                
            },
            fail: function(res) {},
            complete: function(res) {},
        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function() {

    }
})